from Platforms.restapifactory import RestAPIFactory


# quote price and volume, on level


class Quote:
    def __init__(self, platform, commodity_cur, base_cur, level):
        self.price_bid = 0
        self.volume_bid = 0
        self.price_ask = 0
        self.volume_ask = 0

        factory = RestAPIFactory()
        self.platform = factory.get_platform(platform)
        symbol = self.platform.get_symbol(commodity_cur, base_cur)
        self.depth = self.platform.get_depth(symbol)

        self.price_bid = float(self.depth['bids'][level]['price'])
        self.volume_bid = float(self.depth['bids'][level]['amount'])
        self.price_ask = float(self.depth['asks'][level]['price'])
        self.volume_ask = float(self.depth['asks'][level]['amount'])

# recent trades


# class Trades:
#     def __init__(self, platform,
#                  symbol):
#         self.price = 0
#         self.amount = 0

#         if platform == "binance":
#             self.__get_binance(API_KEY[platform], SECRET_KEY[platform], symbol)
#         elif platform == "bitfinex":
#             self.__get_bitfinex(API_KEY[platform], SECRET_KEY[platform], symbol)
